/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author niit
 */
@Entity
@Table(name = "fl_coursemasterial")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FlCoursemasterial.findAll", query = "SELECT f FROM FlCoursemasterial f"),
    @NamedQuery(name = "FlCoursemasterial.findByMaterialid", query = "SELECT f FROM FlCoursemasterial f WHERE f.materialid = :materialid")})
public class FlCoursemasterial implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "materialid")
    private Integer materialid;
    @Lob
    @Size(max = 65535)
    @Column(name = "course_material")
    private String courseMaterial;
    @JoinColumn(name = "courseid", referencedColumnName = "courseid")
    @ManyToOne(optional = false)
    private FlCourse courseid;

    public FlCoursemasterial() {
    }

    public FlCoursemasterial(Integer materialid) {
        this.materialid = materialid;
    }

    public Integer getMaterialid() {
        return materialid;
    }

    public void setMaterialid(Integer materialid) {
        this.materialid = materialid;
    }

    public String getCourseMaterial() {
        return courseMaterial;
    }

    public void setCourseMaterial(String courseMaterial) {
        this.courseMaterial = courseMaterial;
    }

    public FlCourse getCourseid() {
        return courseid;
    }

    public void setCourseid(FlCourse courseid) {
        this.courseid = courseid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (materialid != null ? materialid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FlCoursemasterial)) {
            return false;
        }
        FlCoursemasterial other = (FlCoursemasterial) object;
        if ((this.materialid == null && other.materialid != null) || (this.materialid != null && !this.materialid.equals(other.materialid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.FlCoursemasterial[ materialid=" + materialid + " ]";
    }
    
}
